package com.airS.task.fileMgr.utils.collection;

import java.util.Collection;

/**
 * 集合工具类
 * Created by alan on 2017/3/14.
 */
public class CollectionUtils {
    public static boolean isEmpty(Collection<?> collection) {
        return ((collection == null) || (collection.isEmpty()));
    }

    public static boolean isNotEmpty(Collection<?> collection) {
        return (!(isEmpty(collection)));
    }

    public static <T> T getFirst(Collection<T> collection) {
        return ((isEmpty(collection)) ? null : collection.iterator().next());
    }
}
